package com.nbsaas.boot.common.rest.resource;

import com.nbsaas.boot.common.api.apis.OperationLogApi;
import com.nbsaas.boot.common.data.entity.OperationLog;
import com.nbsaas.boot.common.api.domain.request.OperationLogRequest;
import com.nbsaas.boot.common.api.domain.response.OperationLogResponse;
import com.nbsaas.boot.common.api.domain.simple.OperationLogSimple;
import com.nbsaas.boot.common.rest.convert.OperationLogSimpleConvert;
import com.nbsaas.boot.common.rest.convert.OperationLogEntityConvert;
import com.nbsaas.boot.common.rest.convert.OperationLogResponseConvert;
import com.nbsaas.boot.common.data.repository.OperationLogRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class OperationLogResource extends BaseResource<OperationLog,OperationLogResponse, OperationLogSimple, OperationLogRequest>  implements OperationLogApi {

    @Resource
    private OperationLogRepository operationLogRepository;

    @Override
    public JpaRepositoryImplementation<OperationLog, Serializable> getJpaRepository() {
        return operationLogRepository;
    }

    @Override
    public Function<OperationLog, OperationLogSimple> getConvertSimple() {
        return new OperationLogSimpleConvert();
    }

    @Override
    public Function<OperationLogRequest, OperationLog> getConvertForm() {
        return new OperationLogEntityConvert();
    }

    @Override
    public Function<OperationLog, OperationLogResponse> getConvertResponse() {
        return new OperationLogResponseConvert();
    }




}


